/*
 * CEntity.h
 *
 *  Created on: 27/08/2008
 *      Author: samuel.grigolato
 */

#ifndef CENTITY_H_
#define CENTITY_H_

#include <vector>
#include <string>

#include "CAnimation.h"
#include "CSurface.h"
#include "comum/CRetangulo.h"
#include "comum/CResultadoColisao.h"
#include "CParametros.h"

enum TipoColisao {
	DEFAULT,
	FOGO,
	OBSTACULO,
	ITEM,
	PLAYER
};

class CEntity {

public:
	static std::vector<CEntity*>* EntityList;
	static CResultadoColisao VerificaColisoes(CRetangulo Ret, CEntity* Entidade);
	static bool ConfiguraTileVazio(CEntity* Entidade);

	int X;
	int Y;
	int TileX;
	int TileY;
	int Width;
	int Height;
	int AnimState;
	bool Solido;
	float PorcentagemFisicaWidth;
	float PorcentagemFisicaHeight;

	CEntity();
	virtual ~CEntity();

	virtual bool Init(int posicaoX, int posicaoY);
	virtual bool OnLoad(const char* File, int Width, int Height, int MaxFrames);
	virtual void OnLoop();
	virtual void OnRender(SDL_Surface* Surf_Display);
	virtual void OnCleanup();
	void ProcessaColisoes(TipoColisao TpColisao);
	virtual void ProcessaColisao(CEntity* Entidade, TipoColisao TpColisao);
	std::vector<CEntity*> RecuperaColisoes();
	bool IsTrash();

	CRetangulo GetRetangulo();
	bool Trash;

protected:
	CAnimation ControleAnimacao;
	SDL_Surface* SurfEntity;

};

#endif /* CENTITY_H_ */
